<?php

/**
 * Config
 *
 * Provides access to all of the various warlock config options and general
 * info.
 *
 * Warlock is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 *
 * @package    warlock
 * @author     David Cole <neophyte@sourcetutor.com>
 * @license    GNU/GPL v2
 */

// Object dependencies
using('Library.DataTypes.Array.Conversion');
using('Library.Patterns.Registry');

class Model extends Registry
{
    /**#@+
     * Required Core Objects
     *
     * These are references to the core objects required by this
     * class.
     *
     * @access private
     * @var    object
     */
    var $_Error;
    /**#@-*/

    /**
     * Constructor
     *
     * General initialisation, default model
     * settings.
     *
     * @return Config
     */
    function __construct()
    {
        // Add self to Vault
        Vault::Add('Model', &$this);

        // Initialise the registry
        parent::__construct();

        // Grab references to required objects
        $this->_Error = &Vault::Get('Debug_Error');

        /*
         * Set the default values of the model
         */

        $this->_registry = array('Application' => 'Website',
                                 'View'        => 'HTML',
                                 'Page'        => array('Title'        => '',
                                                        'Description'  => '',
                                                        'Keywords'     => array(),
                                                        'Copyright'    => '',
                                                        'Author'       => '',
                                                        'Language'     => 'en',
                                                        'Charset'      => 'utf-8',
                                                        'Body'         => array()));
    }

    function Body($type = 'text', $data = '', $name = false, $renderer = false)
    {
        $this->_registry['Page']['Body'][] = array('data'     => $data,
                                                   'type'     => $type,
                                                   'renderer' => $renderer,
                                                   'name'     => $name);
    }
}

?>